<template>
  <mt-button icon="back" @click="handleBack"></mt-button>
</template>

<script>
export default {
  componentName: 'MHeaderBack',
  props: {
    to: {
      type: [String, Object]
    }
  },
  methods: {
    handleBack () {
      if (this.to) {
        this.$router.push(this.to)
      } else {
        history.back()
      }
    }
  }
}
</script>
